package kr.ne.jay.SimpleString;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class SimpleString extends Activity implements OnClickListener {
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	setContentView(R.layout.main);
    	findViewById(R.id.start_button).setOnClickListener(this);
    	findViewById(R.id.exit_button).setOnClickListener(this);
    	findViewById(R.id.about_button).setOnClickListener(this);
    }

    @Override
	public void onClick(View v) {
    	switch(v.getId())
    	{
    	case R.id.start_button:
    		Intent iShow = new Intent(this, StringShow.class);
    		startActivity(iShow);
    		break;    	
    	case R.id.about_button:
    		Intent iAbout = new Intent(this, About.class);
    		startActivity(iAbout);
    		break;
    	case R.id.exit_button:
    		finish();
    		break;
    	}
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    	super.onCreateOptionsMenu(menu);
    	MenuInflater inflater = getMenuInflater();
    	inflater.inflate(R.menu.menu, menu);
    	return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    	switch(item.getItemId()) {
    	case R.id.setting:
    		startActivity(new Intent(this, Settings.class));
    		return true;    	
    	}
    	return false;
    }
}